package ro.gateway.aida.sectors;

import org.apache.struts.action.ActionForm;

import ro.gateway.aida.obj.AIDASector;



/**
 * <p>Title: Romanian AIDA</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (comparator) 2003</p>
 * <p>Company: ro-gateway</p>
 * @author Mihai Popoaei, mihai_popoaei@yahoo.com, smike@intellisource.ro
 * @version 1.0-* @version $Id: SectorChooserForm.java,v 1.1 2004/10/24 23:37:09 mihaipostelnicu Exp $
 */
public class SectorChooserForm extends ActionForm
{
      String action = null;
      int sector_id = -1;
      int subsector_id = -1;
      int subsector1_id = -1;
      AIDASector sector = null;
      AIDASector subsector = null;
      AIDASector subsector1 = null; // nepot

      public int getSector_id()
      {
            return sector_id;
      }

      public void setSector_id( int sector_id )
      {
            this.sector_id = sector_id;
      }

      public int getSubsector_id()
      {
            return subsector_id;
      }

      public int getSubsector1_id()
      {
            return subsector1_id;
      }

      public void setSubsector_id( int subsector_id )
      {
            this.subsector_id = subsector_id;
      }

      public void setSubsector1_id( int subsector1_id )
      {
            this.subsector1_id = subsector1_id;
      }

      //finder
      int selected_index = -1;
      SectorWrapper[] found_sectors = null;
      String what = null;

      public int getSectorId()
      {
            if ( sector == null ) return -1;
            return sector.getRo_aida_code();
      }

      public int getSubsectorId()
      {
            if ( subsector == null ) return -1;
            return subsector.getRo_aida_code();
      }

      public int getSubsector1Id()
      {
            if ( subsector1 == null ) return -1;
            return subsector1.getRo_aida_code();
      }

      public int getSelected_index()
      {
            return selected_index;
      }

      public void setSelected_index( int selected_index )
      {
            this.selected_index = selected_index;
      }

      public String getWhat()
      {
            return what;
      }

      public void setWhat( String what )
      {
            this.what = what;
      }

      public SectorWrapper[] getFound_sectors()
      {
            return found_sectors;
      }

      public void setFound_sectors( SectorWrapper[] found_sectors )
      {
            this.found_sectors = found_sectors;
      }

      public AIDASector getSector()
      {
            return sector;
      }

      public void setSector( AIDASector sector )
      {
            this.sector = sector;
      }

      public AIDASector getSubsector()
      {
            return subsector;
      }

      public AIDASector getSubsector1()
      {
            return subsector1;
      }

      public void setSubsector( AIDASector subsector )
      {
            this.subsector = subsector;
      }

      public void setSubsector1( AIDASector subsector1 )
      {
            this.subsector1 = subsector1;
      }

      public String getAction()
      {
            return action;
      }

      public void setAction( String action )
      {
            this.action = action;
      }

      public String getMarkedField()
      {
            if ( sector == null )
            {
                  return "sector";
            }
            if ( subsector == null )
            {
                  return "subsector";
            }
            return "subsector1";
      }

      public void clear_objects()
      {
            this.sector = null;
            this.subsector = null;
            this.subsector1 = null;
            sector_id = -1;
            subsector_id = -1;
            subsector1_id = -1;
      }
}
